
//
//  CityTableViewCell.m
//  PTravel
//
//  Created by dllo on 15/11/24.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "CityTableViewCell.h"

@implementation CityTableViewCell

- (void)dealloc
{
    [_cname release];
    [_ename release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return self;
}

- (void)createSubView
{
    self.cname = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, BOUNDS.size.width-20, 26)];
    [self.contentView addSubview:self.cname];
    [_cname release];
    
    self.ename = [[UILabel alloc] initWithFrame:CGRectMake(15, 26, BOUNDS.size.width-20, 26)];
    [self.contentView addSubview:self.ename];
    [_ename release];
    
}

- (void)setCity:(TotalCity *)city
{
    if (_city != city) {
        [_city release];
        _city = [city retain];
    }
    self.cname.text = city.cnname;
    self.ename.text = city.enname;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
